use crate::core::base::meta;
use crate::core::base;
use crate::core::model::data::Data;

pub fn let_(yuzu: &str, name: &str, data: &Data) {
    let data_type = meta::set_var(yuzu, name, data.clone());
    base::log().debug(format!("[{}] let {} = {} ({})", yuzu, name, data, data_type));
}

pub fn un_let(yuzu: &str, name: &str, data: &Data) {
    if !meta::var_is_exist(yuzu, name) {
        base::log().err_exit(format!("[{}] `{}` is not exist", yuzu, name))
    }
    let data_type = meta::set_var(yuzu, name, data.clone());
    base::log().debug(format!("[{}] {} = {} ({})", yuzu, name, data, data_type));
}